/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.emergency.command.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencyModDictEnum;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencySysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 应急事故
 *
 * @author cx
 * @date 2024-01-19 13:18:22
 */
@Data
@TableName("er_accident")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "应急事故")
public class ErAccidentEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 数据所属模块
	*/
    @Schema(description="数据所属模块")
    private String dataModule;

	/**
	* 事故名称
	*/
    @Schema(description="事故名称")
    private String accidentName;

	/**
	* 报警时间
	*/
    @Schema(description="报警时间")
    private Date alarmTime;

	/**
	* 事故单位地址
	*/
    @Schema(description="事故单位地址")
    private String companyAddress;

	/**
	* 地区
	*/
    @Schema(description="地区")
    private String companyRegionId;

	/**
	* 报警人
	*/
    @Schema(description="报警人")
    private String alarmPeople;

	/**
	* 报警人电话
	*/
    @Schema(description="报警人电话")
    private String alarmPeoplePhone;

	/**
	* 性别
	*/
    @Schema(description="性别")
    private String alarmPeopleSex;

	/**
	* 事故来源
	*/
    @Schema(description="事故来源")
    private String accidentOrigin;

	/**
	* 事故类型
	*/
    @Schema(description="事故类型")
    private String accidentType;

	/**
	* 接警人
	*/
    @Schema(description="接警人")
    private String receiveAlarmPeople;

	/**
	* 事故发生时间
	*/
    @Schema(description="事故发生时间")
    private Date accidentOccurrenceTime;

	/**
	* 事故确认时间
	*/
    @Schema(description="事故确认时间")
    private Date accidentConfirmTime;

	/**
	* 救援开始时间
	*/
    @Schema(description="救援开始时间")
    private Date rescueStartTime;

	/**
	* 经度
	*/
    @Schema(description="经度")
    private String longitude;

	/**
	* 维度
	*/
    @Schema(description="维度")
    private String latitude;

	/**
	* 定位
	*/
    @Schema(description="定位")
    private String location;

	/**
	* 轻伤人员
	*/
    @Schema(description="轻伤人员")
    private Integer minorWoundNum;

	/**
	* 死亡人员
	*/
    @Schema(description="死亡人员")
    private Integer dieNum;

	/**
	* 重伤人员
	*/
    @Schema(description="重伤人员")
    private Integer severeWoundNum;

	/**
	* 被困人员
	*/
    @Schema(description="被困人员")
    private Integer treppedNum;

	/**
	* 工作单号
	*/
    @Schema(description="工作单号")
    private String workOrderNo;

	/**
	* 直接经济损失(万元)
	*/
    @Schema(description="直接经济损失(万元)")
    private BigDecimal directLoss;

	/**
	* 事故概况
	*/
    @Schema(description="事故概况")
    private String accidentDesc;

	/**
	* 事故处理意见
	*/
    @Schema(description="事故处理意见")
    private String accidentHandleOpinion;

	/**
	* 失踪人员
	*/
    @Schema(description="失踪人员")
    private Integer missingNum;

	/**
	* 附件
	*/
    @Schema(description="附件")
    private String attachmentFile;

	/**
	* 事故状态
	*/
    @Schema(description="事故状态")
    private Integer accidentStatus;

	/**
	* 救援状态
	*/
    @Schema(description="救援状态")
    private Integer rescueStatus;

	/**
	* 结案状态
	*/
    @Schema(description="结案状态")
    private Integer closeStatus;

	/**
	* 是否启动预案
	*/
    @Schema(description="是否启动预案")
    private String isStartPlan;

	/**
	* 启动人
	*/
    @Schema(description="启动人")
    private String startPeople;

	/**
	* 启动时间
	*/
    @Schema(description="启动时间")
    private Date startTime;

	/**
	* 响应级别
	*/
    @Schema(description="响应级别")
    private Integer responseLevel;

	/**
	* 疏散半径(m)
	*/
    @Schema(description="疏散半径(m)")
    private Integer evacuationRadius;

	/**
	* 预案标识
	*/
    @Schema(description="预案标识")
    private Long planId;

	/**
	* 预案编号
	*/
    @Schema(description="预案编号")
    private String planNo;

	/**
	* 预案名称
	*/
    @Schema(description="预案名称")
    private String planName;

	/**
	* 事故等级
	*/
    @Schema(description="事故等级")
    private Integer accidentLevel;

	/**
	* 预案事故类型
	*/
    @Schema(description="预案事故类型")
    private String planAccidentType;

	/**
	* 进展情况
	*/
    @Schema(description="进展情况")
    private String progressDesc;

	/**
	* 事故评估
	*/
    @Schema(description="事故评估")
    private String accidentAssess;

	/**
	* 应急启动经过描述
	*/
    @Schema(description="应急启动经过描述")
    private String startProcessDesc;

	/**
	* 事故研判附件
	*/
    @Schema(description="事故研判附件")
    private String accidentJudgeFile;

	/**
	* 救援结束时间
	*/
    @Schema(description="救援结束时间")
    private Date rescueEndTime;

	/**
	* 结束经过描述
	*/
    @Schema(description="结束经过描述")
    private String rescueProcessDesc;

	/**
	* 结束附件
	*/
    @Schema(description="结束附件")
    private String rescueEndFile;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	public String getAccidentTypeStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_accident_type, this.getAccidentType());
	}
	public String getAccidentStatusStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_accident_status, this.getAccidentStatus());
	}

	public String getIsStartPlanStr(){
		return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.getIsStartPlan());
	}

	public String getPlanIdStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencyModDictEnum.emergency_company_plan_id, this.getPlanId());
	}


	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company,this.orgId);
	}

}
